package com.yunhe.marketing.client.fallback;

import com.yunhe.common.model.ResultObject;
import com.yunhe.common.util.FallbackUtil;
import com.yunhe.marketing.client.AuthorityClient;
import feign.hystrix.FallbackFactory;
import org.springframework.http.ResponseEntity;

/**
 * @Author: DongWenYu
 * @Date: 2021/2/23 14:27
 */
public class AuthorityFallbackFactory implements FallbackFactory<AuthorityClient> {
    @Override
    public AuthorityClient create(Throwable cause) {
        return new AuthorityClient() {
            @Override
            public ResponseEntity<ResultObject> getByUnifiedSocialCreditCode(String unifiedSocialCreditCode) {
                return FallbackUtil.getDefaultFallBack();
            }
        };
    }
}
